package com.hyperfix.washer.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hyperfix.models.washer.dtos.ParamTypeStatistic;
import com.hyperfix.models.washer.dtos.RecordDTO;
import com.hyperfix.models.washer.pojos.Record;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author JiangChunYu
 * 2024/4/3
 */
@Mapper
public interface RecordMapper extends BaseMapper<Record> {
    IPage<RecordDTO> listRecordDTO(IPage<RecordDTO> recordDTOPage,
                                   @Param("startRecordTime") String startRecordTime,
                                   @Param("endRecordTime") String endRecordTime);

    int countRecordDTO(@Param("startRecordTime") String startRecordTime,
                       @Param("endRecordTime") String endRecordTime);

    Long statisticDayTotalFlow(@Param("start") LocalDateTime startOfToday, @Param("end") LocalDateTime endOfToday);

    List<ParamTypeStatistic> statisticParamType(@Param("teamId") Integer teamId,
                                                    @Param("start") LocalDateTime startOfWeek,
                                                    @Param("end") LocalDateTime endOfToday);

    Integer getMaxTotalFlow(@Param("start") LocalDateTime startOfDay, @Param("end") LocalDateTime endOfDay);

    List<Integer> getDayTotalFlowList(@Param("timeList") List<String> timeNameList);
}
